#ifndef __DEVRECODE_H__
#define __DEVRECODE_H__

#include "GDDevBase.h"

 #define rocde_enableFLag         0xcc     //档案的有效标志
 #define rocde_disableFLag        0x33     //档案的无效标志

 #define all_delete               1     
 #define one_delete               0
 #define errorFlag                0xff 
 #define addrNULL                 0         //空地址
 #define enumType                 0         //枚举类型
 #define rangType                 1         //范围类型
 #define reg_desc1_num            1 
 #define reg_desc2_num            2 
 #define reg_desc3_num            3 
 #define ytEnableFlag             1
 #define ytdisableFlag            0 

 #define auto_search_enable       1
 #define auto_search_disable      0

 #define fine_dev_maxTimes        5
 #define Maximum_Packet_Size       200      //最大读取长度

#define     StartFlag       0
#define     DataFlag        1
#define     EndFlag         2

// #define signLen_645  24  //645的标识长度，68+地址+68+长0-度+密码+校验+sum+16=24
// #define recodelen_MAX  4096  //后续采用malloc的方式去增加


enum DataType_all{
    type_BIT,
    type_u16,
    type_s16,//补码

    type_s16_sign,//原码

    type_s32_abcd,
    type_s32_dcba,
    type_s32_badc,
    type_s32_cdab,

    type_u32_abcd,
    type_u32_dcba,
    type_u32_badc,
    type_u32_cdab,

    type_s32_sign,//原码

    type_float_abcd,
    type_float_dcba,
    type_float_badc,
    type_float_cdab,

    type_char,
    type_max,
};


static const char*manufactureritems[]={
    "SUNGROW", 
};

enum{
    recodeNum1,
    recodeNum2,
    recodeNum3,
    recodeNum4,
    recodeNum5,
    recodeNum6,
    recodeNum7,
    recodeNum8,
    recodeNum9,
    recodeNum10,
    recodeNum11,
    recodeNum12,
};

typedef enum {
    DEV_NULL,
    DEV_INV,
    DEV_SWITCH,
} DEV_TYPE;

// typedef struct
// {
//     char manufacturer[32];
//     u16 version; 
// }Inv_Type;//逆变器类型


typedef struct
{
    u8   num;       //编号
    char manufacturer[32];
    u16 version; 
}Inv_SeekType;//逆变器档案查找类型

// typedef struct
// {
// 	char manufacturer[32];
//     u16 version; 
//     u32 len;
//     u16 checkCrc16;
//     char recode_Jsion[MAXRECODELEN];
// }RecodePage_Type;//下发档案库类型


typedef struct
{
	u8 deleteType;      //是否删除所有协议，0x00否，0x01是
    char manufacturer[32];
    u16 version;   
}DeleteRecode_Type;//下发档案库类型


typedef struct
{
	u8 inv_num;      //逆变器编号
    char manufacturer[32];
    u16 version;    
}Inv_infor;//下发档案库类型

typedef struct
{
    char manufacturer[32];
    u16 version;   
    DEV_TYPE devType;
}Delete_Recode;

typedef struct
{
    u8 changeFlag;//01，修改广播序号，02修改单播序号
    // u8 broadNum;
    u8 broadNum_add;//修改原有的序号，这里做保存
    // u8 singleNum;
    u8 singleNum_add;//修改原有的序号，这里做保存
}Feature_type;

enum 
{
    broad_type=1,//广播
    single_type//单播
};



extern u8 Inv_num;//


//逆变器
void Inv_agmtDeal();


#endif